package com.doitedu.day04.funcs

/**
 * @Date 22.6.23
 * @Created by HANGGE
 * @Description
 */
object _02Partition {
  def main(args: Array[String]): Unit = {
    val  ls = List("hava" , "hbase" , "java" , "hadoop", "java","hadoop")
   // 条件分组  只有满足条件的和不满足条件的
    val tuple: (List[String], List[String]) = ls.partition(_.startsWith("h"))
    println(tuple._1)
    println(tuple._2)
    // 从头开始判断  遇到不符合条件的 发分组终止
    val tuple1: (List[String], List[String]) = ls.span(_.startsWith("h"))
    println(tuple1._1)
    println(tuple1._2)


  }

}
